<template>
    <div>

<el-row >
       <el-col :span="24">
        <el-form   class="demo-form-inline">
          <el-form-item >
              <el-input  placeholder="请输入融资企业名称" v-model="financeName" style="float:left;width:300px;margin-left:200px"></el-input>
              <el-input  placeholder="请输入核心企业名称" v-model="coreName" style="float:left;width:300px;margin-left:10px"></el-input>
              <el-button icon="el-icon-search"  type="primary"  style="float:left" @click="doSearchBtn"></el-button>
              <el-select v-model="auditResult" clearable placeholder="请选择审核结果"  @change="doSelect" style="margin-left:100px">
                <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
                </el-option>
            </el-select>
           </el-form-item>
             </el-form>
             
       </el-col>
</el-row>

<el-row>
  <el-col :span="24">
    <el-table
:data="tableData"
    border
style="width: auto;">
<el-table-column
  type="index"
  label="序号"
  align="center"
  width="50"
></el-table-column>
<el-table-column
  label="融资企业名称"
  align="center"
  >
<template slot-scope="scope">{{ scope.row.financeName }}</template>

</el-table-column>
<el-table-column
  label="核心企业名称"
  align="center"
  >
<template slot-scope="scope">{{ scope.row.coreName }}</template>

</el-table-column>
<el-table-column
  label="审核结果"
  align="center">
  <template slot-scope="scope">
    <label v-if="scope.row.auditResult==0">待审核</label>
    <label v-if="scope.row.auditResult==1">通过</label>
    <label v-if="scope.row.auditResult==2">未通过</label>
  </template>

</el-table-column>
<el-table-column
  prop="recommendationTime"
  label="推荐时间"
  align="center">
</el-table-column>
</el-table>
  </el-col>
</el-row>

<el-row>
       <el-col :span="24" :offset="6">
        <el-pagination
          
          background
          @size-change="sizeChange"
          @current-change="currentChange"
          :current-page="pageNum"
          :page-sizes="[3, 6, 9]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total">
        </el-pagination>
        </el-col>
    </el-row>
</div>
</template>

<script>
export default {
    data(){
            return{
                tableData:[],
                pageNum:1,
                pageSize:3,
                total:0,
                financeName:'',
                coreName:'',
                auditResult:'',
                options:[
                    {value:'0',label:'待审核'},
                    {value:'1',label:'通过'},
                    {value:'2',label:'未通过'},
                ]

            }
        },
        created(){
            this.getAuditRecord()
        },
        methods:{
            doSelect(e){
                console.log(e)
                this.auditResult = e
                this.pageNum = 1
                this.getAuditRecord()
            },
            doSearchBtn(){
                this.pageNum = 1
                this.getAuditRecord()
            },
            currentChange(p){
                this.pageNum=p
                this.getAuditRecord()
             },
            sizeChange(p){
                this.pageNum=1
                this.pageSize=p
                this.getAuditRecord()
            },
            getAuditRecord(){
                let param ={}
                param.pageNum = this.pageNum
                param.pageSize = this.pageSize
                let data = {}
                data.financeName = this.financeName
                data.coreName = this.coreName
                data.auditResult = this.auditResult
                param.data = data
                this.$axios.post('api/recommendationRecord/queryRecord',param,{headers:{'jwt':localStorage.getItem('jwt')}})
                .then(res=>{
                    
                    let pageDate = res.data.data
                   
                    this.tableData = pageDate.list
                    this.pageNum = pageDate.pageNum
                    this.pageSize = pageDate.pageSize
                    this.total = pageDate.total
                })
            }
        }
}
</script>

<style scoped>

</style>